package cn.ultrarisk.scadmin.manager.biz.stat.entity;

import cn.ultrarisk.scadmin.manager.biz.stat.context.StatType;
import cn.ultrarisk.mybatis.extension.annotation.Table;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;


/**
 * solr节点统计实体类
 *
 * @author sevendlong(lin23871@163.com)
 * @date 2014/4/14
 * @since V1.0
 */
@Table(table = "solr_node_stat", idColumn = SolrNodeStat.ID, autoIncrement = true)
public class SolrNodeStat implements Serializable {
    private static final long serialVersionUID = -4847081235539137345L;

    public final static String ID = "id";
    public final static String NODE_ID = "node_id";
    public final static String TYPE = "type";
    public final static String MAX_MEMUSAGE = "max_memusage";
    public final static String AVG_MEMUSAGE = "avg_memusage";
    public final static String MAX_LOAD = "max_load";
    public final static String AVG_LOAD = "avg_load";
    public final static String START_TIME = "start_time";
    public final static String END_TIME = "end_time";

    public static final Map<String, String> COLUMN_PROPERTY_MAP = new LinkedHashMap<String, String>();

    static {
        COLUMN_PROPERTY_MAP.put(ID, "id");
        COLUMN_PROPERTY_MAP.put(NODE_ID, "nodeId");
        COLUMN_PROPERTY_MAP.put(TYPE, "type");
        COLUMN_PROPERTY_MAP.put(MAX_MEMUSAGE, "maxMemusage");
        COLUMN_PROPERTY_MAP.put(AVG_MEMUSAGE, "avgMemusage");
        COLUMN_PROPERTY_MAP.put(MAX_LOAD, "maxLoad");
        COLUMN_PROPERTY_MAP.put(AVG_LOAD, "avgLoad");
        COLUMN_PROPERTY_MAP.put(START_TIME, "startTime");
        COLUMN_PROPERTY_MAP.put(END_TIME, "endTime");
    }

    /**
     * id
     */
    private Long id;
    /**
     * 节点id
     */
    private Integer nodeId;
    /**
     * 统计类型
     */
    private StatType type;
    /**
     * 内存使用最大值
     */
    private Long maxMemusage;
    /**
     * 内存使用平均值
     */
    private Long avgMemusage;
    /**
     * 系统负载最大值
     */
    private Double maxLoad;
    /**
     * 系统负载平均值
     */
    private Double avgLoad;
    /**
     * 统计开始时间
     */
    private Long startTime;
    /**
     * 统计结束时间
     */
    private Long endTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getNodeId() {
        return nodeId;
    }

    public void setNodeId(Integer nodeId) {
        this.nodeId = nodeId;
    }

    public StatType getType() {
        return type;
    }

    public void setType(StatType type) {
        this.type = type;
    }

    public Long getMaxMemusage() {
        return maxMemusage;
    }

    public void setMaxMemusage(Long maxMemusage) {
        this.maxMemusage = maxMemusage;
    }

    public Long getAvgMemusage() {
        return avgMemusage;
    }

    public void setAvgMemusage(Long avgMemusage) {
        this.avgMemusage = avgMemusage;
    }

    public Double getMaxLoad() {
        return maxLoad;
    }

    public void setMaxLoad(Double maxLoad) {
        this.maxLoad = maxLoad;
    }

    public Double getAvgLoad() {
        return avgLoad;
    }

    public void setAvgLoad(Double avgLoad) {
        this.avgLoad = avgLoad;
    }

    public Long getStartTime() {
        return startTime;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    public Long getEndTime() {
        return endTime;
    }

    public void setEndTime(Long endTime) {
        this.endTime = endTime;
    }
}